﻿<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title>Embedded</title>
    <style type="text/css">
        html, body {
            height: 100%;
            margin: 0;
            padding: 0;
        }

        .window__titlbar--shown header {
            display: none;
        }

        .window__titlbar--hidden header {
            color: white;
            padding: 10px;
            text-align: center;
            app-region: drag;
        }

        .window--activated header {
        }

        .window--deactivated header {
        }

        main {
            padding: 20px;
        }

        #activated-status {
            width: 60px;
        }

        .window--activated #activated-status {
            background-color: green;
        }

        .window--deactivated #activated-status {
            background-color: dimgray;
        }

        .window--activated #activated-status:after {
            background-color: green;
            content: "ACTIVATED";
        }

        .window--deactivated #activated-status:after {
            background-color: dimgray;
            content: "DEACTIVATE"
        }
    </style>
</head>
<body>
    <header>
        <span>WinFormedge App</span>
    </header>

    <main>
        <div>
            <button id="minimizeButton" app-command="Minimize">Minimize</button>
            <button id="maximizeButton" app-command="Maximize" title="最大化">Toggle Maximize</button>
            <button id="fullscreenButton" app-command="FullScreen">Toggle FullScreen</button>
            <button id="closeButton" app-command="Close">Close</button>
        </div>

        <div>
            Activated: <span id="activated-status"></span>
        </div>

        <div>
            <button id="openChildWindow">开窗测试</button>
        </div>
    </main>

    <script>
        (() => {
            const btn = document.getElementById("openChildWindow");
            if (btn) {
                btn.addEventListener("click", () => {
                    chrome.webview.hostObjects.sync.testWindow.OpenSubWindow();
                });
            }
        })();
    </script>
</body>
</html>